// src/stores/useUserStore.ts
import { defineStore } from 'pinia'

export const useUserStore = defineStore('user', {
    state: () => ({
        username: '',
        isAuthenticated: false,
    }),
    actions: {
        login(name: string) {
            this.isAuthenticated = true
            this.username = name
        },
        logout() {
            this.isAuthenticated = false
            this.username = ''
        }
    }
})
